<script setup>
import { ref } from 'vue'

defineProps({
  msg: String,
})

const count = ref(0)

import { useCounterStore } from '../store/counter'
const counterStore = useCounterStore()
import { storeToRefs } from 'pinia'
const { counter } = storeToRefs(counterStore)
const { increment } = counterStore

</script>

<template>
  <h1>{{ msg }}</h1>

  <div class="card px-3">
    <button 
      class="border border-blue-500 px-3 py-1 hover:bg-blue-500 hover:text-white"
      type="button" @click="increment">count is {{ counter }}</button>
    <p>
      Edit
      <code>components/HelloWorld.vue</code> to test HMR
    </p>
  </div>

</template>

<style scoped>
</style>
